using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CHEnhanceEfCore.Models
{
    /// <summary>
    /// 地址模型类
    /// author: chenhao
    /// </summary>
    [Table("address")]
    public class Address
    {
        /// <summary>
        /// 主键id
        /// </summary>
        [Key]
        [Column("id")]
        public Guid id { get; set; }

        /// <summary>
        /// 创建时间/注册时间
        /// </summary>
        [Column("create_time")]
        public DateTime createTime { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        [Column("modify_time")]
        public DateTime modifyTime { get; set; }

        /// <summary>
        /// 地址详情
        /// </summary>
        [Column("address_detail")]
        public string addressDetail { get; set; }

        /// <summary>
        /// 区域编码
        /// </summary>
        [Column("area_code")]
        public string areaCode { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        [Column("city")]
        public string city { get; set; }

        /// <summary>
        /// 区县
        /// </summary>
        [Column("district")]
        public string district { get; set; }

        /// <summary>
        /// 用户id，外键
        /// </summary>
        [Column("id_user")]
        public Guid userId { get; set; }

        /// <summary>
        /// 是否设为默认地址
        /// </summary>
        [Column("is_default")]
        public bool isDefault { get; set; }

        /// <summary>
        /// 是否已删除
        /// </summary>
        [Column("is_delete")]
        public bool isDelete { get; set; }

        /// <summary>
        /// 联系人姓名
        /// </summary>
        [Column("name")]
        public string name { get; set; }

        /// <summary>
        /// 邮政编码
        /// </summary>
        [Column("post_code")]
        public string postCode { get; set; }

        /// <summary>
        /// 省份
        /// </summary>
        [Column("province")]
        public string province { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [Column("tel")]
        public string phone { get; set; }
    }
}